Skip to content

Remove standard: search operator#2844

Open
bendichter wants to merge 3 commits into
masterfrom
fix-standard-search-operator
Open

Remove standard: search operator#2844
bendichter wants to merge 3 commits into
masterfrom
fix-standard-search-operator

Conversation

@bendichter
Copy link
Copy Markdown
Member

@bendichter bendichter commented Jun 1, 2026

Summary

The standard: search operator (e.g. standard:NWB) never returned results against real data, and it isn't providing enough value to justify keeping a half-working operator around. This PR removes standard: entirely. It can be re-added later, wired to the correct metadata source.

Why it was broken

standard: matched $.dataStandard[*].name against asset metadata, but assets don't carry a dataStandard field — the data standard is reported on the Version's assetsSummary.dataStandard, so the jsonpath never matched.

Verified against the sandbox API:

  • standard:nwb / standard:NWB0 results
  • (sibling operators that do live on assets work, e.g. species:mouse → 134, technique:two-photon → 12)

Rather than relocate it to match the version metadata, we're dropping it for now since it's low-value, and re-introducing it cleanly later is straightforward.

Changes

  • parser.py — removed standard from OPERATOR_KEYS; an unknown standard: token now falls through to the standard 400 + "did you mean?" handling.
  • filters.py — removed standard from _ASSET_OPS/_NAME_PATH_OPS, and reverted _jsonpath_name_match to its single-column form (the column generalization existed only to serve standard).
  • serializers.py — dropped standard from the API search help text.
  • DandisetSearchField.vue — removed the standard:nwb example from the frontend operator hints.
  • test_dandiset.py — removed test_advanced_search_standard_matches and the now-unused version_metadata param on the _seed_dandiset_with_asset helper.

Testing

ruff check passes on the changed files. The remaining search operator tests (species/approach/technique/file_type + the unknown-operator suggestion path) are unaffected.

🤖 Generated with Claude Code

The `standard:` operator matched `$.dataStandard[*].name` against asset
metadata, but `dataStandard` is reported on the Version's assetsSummary,
not on individual assets — so it never matched and always returned 0
results in production.

Match `standard:` against the Version metadata
(`$.assetsSummary.dataStandard[*].name`) instead, restricting the
dandiset queryset to dandisets with a matching version. The existing
test was rewritten to seed `dataStandard` on the version assetsSummary
(where it actually lives) rather than on the asset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yarikoptic
Copy link
Copy Markdown
Member

rebase/merge -- I fixed up frontend e2e testing

@bendichter bendichter marked this pull request as ready for review June 2, 2026 22:15
The standard: operator never worked reliably against real data and isn't
providing enough value to keep. Remove it from the parser operator set,
filter logic, API help text, and frontend examples. Can be re-added later
once it's matched against the right metadata source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bendichter bendichter changed the title Fix standard: search operator (matches version dataStandard) Remove standard: search operator Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants